import request from "@/utils/request";

// 学员分页查询
export const queryStudentPageApi = (name, degree, clazzId, page, pageSize) =>
  request.get(
    `/students?name=${name}&degree=${degree}&clazzId=${clazzId}&page=${page}&pageSize=${pageSize}`
  );

// 添加学员
export const addStudent = (student) => request.post("/students", student);

// 根据ID查询学员
export const queryStudentById = (id) => request.get(`/students/${id}`);

// 修改学员
export const updateStudent = (student) => request.put("/students", student);

// 删除学员(支持批量删除)
export const deleteStudentApi = (ids) => request.delete(`/students/${ids}`);


// 学员违纪处理
export const handleViolation = (id, score) =>
  request.put(`/students/violation/${id}/${score}`);
